<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Routing\Router;

class TokenController extends Controller
{
    public function createToken(Request $request){

         //接口检测部分
        // 客户端参数
        $client_id=$request->input('client_id',0);
        $router_client=$request->input('router_client',0);
        $api_token=$request->input('api_token',0);//由客户端生成，规则同服务端$api_token_server

        //根据client_id去数据库查找对应的client_secret ,
        $client_secret=getClientsecretById($client_id);


        $router=$request->path();//路由名字
        $api_token_server =md5($router.date('Y-m-d',time()).$client_secret);
        if($api_token!=$api_token_server){
            exit('接口非法访问！');

        }

        //用户登陆验证检测部分


    }
}
